/* GUI CONVERTED from rccclup.p (converter v1.76) Mon Jul 30 07:02:32 2001 */
/* rccclup.p - CONTAINER LINE CHARGE UPDATE WITH NEW SHIPPER ID         */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.5 $                                                 */
/*                                                                      */
/* $Revision: 1.5 $     BY: Steve Nugent DATE: 07/16/01 ECO: *P006* */
/*V8:ConvertMode=Maintenance                                            */
/*                                                                          */
/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */
/*                                                                          */
/*         THIS PROGRAM IS A BOLT-ON TO STANDARD PRODUCT MFG/PRO.           */
/* ANY CHANGES TO THIS PROGRAM MUST BE PLACED ON A SEPARATE ECO THAN        */
/* STANDARD PRODUCT CHANGES.  FAILURE TO DO THIS CAUSES THE BOLT-ON CODE TO */
/* BE COMBINED WITH STANDARD PRODUCT AND RESULTS IN PATCH DELIVERY FAILURES.*/
/*                                                                          */
/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */
/*                                                                          */

/*---------------------------------------------------------------------------
  Purpose: This program updates the Shipment Detail Line Charge (abls_det)
           and the Shipment Line Item Detail (absd_det) tables with the new
           shipper ID when a pre-shipper is converted to a shipper.

  Notes:
----------------------------------------------------------------------------*/


{mfdeclre.i}

define input parameter shipfrom like abs_shipfrom no-undo.
define input parameter old_id like abs_id no-undo.
define input parameter new_id like abs_id no-undo.


/* UPDATE SHIPMENT DETAIL LINE CHARGE RECORDS WITH THE NEW */
/* SHIPPER ID.                                             */

for each absl_det exclusive-lock
   where
      absl_abs_id = old_id
   and absl_abs_shipfrom = shipfrom:

   absl_abs_id = new_id.
end. /* FOR EACH absl_det */


/* UPDATE SHIPMENT LINE ITEM DETAIL RECORDS WITH THE NEW */
/* SHIPPER ID.                                           */

for each absd_det exclusive-lock
   where
      absd_abs_id = old_id
   and absd_shipfrom = shipfrom:

   absd_abs_id = new_id.

end. /* FOR EACH absd_det */

/* UPDATE THE SALES ORDER DETAIL LINE CHARGE RECORDS CREATED */
/* USING THE SHIPPER WORKBENCH, WITH THE NEW SHIPPER ID */

for each sodlc_det exclusive-lock
   where
      sodlc_owned_by = old_id
   and sodlc_abs_shipfrom = shipfrom:

   sodlc_owned_by = new_id.
end.  /* FOR EACH sodlc_det */

/* UPDATE THE SALES ORDER DETAIL CONTAINER CHARGE RECORDS CREATED */
/* USING THE SHIPPER WORKBENCH, WITH THE NEW SHIPPER ID */

for each abscc_det exclusive-lock
   where
       abscc_abs_id = old_id
   and abscc_abs_shipfrom = shipfrom:

   abscc_abs_id = new_id.
end.  /* FOR EACH abscc_det */
